package noahfacade;

import java.util.Properties;

//start extract MainApplication
public class MainApplication {
    //...
    private Properties props;
    private CustomerDatabase custDB;
    //...
    public synchronized CustomerDatabase createDBFacade() {
        if ( custDB == null ) {
            try {
                String dbClassName 
                    = props.getProperty( "db.class", 
                                         "com.mcli.app.StubCustomerDB");
                Class cls = Class.forName(dbClassName);
                custDB = (CustomerDatabase) cls.newInstance();
            }
            catch (ClassNotFoundException ex) {
                // ...
            }
            catch (InstantiationException ex) {
                // ...
            }
            catch (IllegalAccessException ex) {
                // ...
            }
        }
	return custDB;
    }
}
//stop extract MainApplication
